<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf;assembly=MaterialDesignThemes.Wpf"
                    xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters;assembly=MaterialDesignThemes.Wpf">

    <converters:ClockLineConverter x:Key="ClockHourLineConverter" DisplayMode="Hours" />
    <converters:ClockLineConverter x:Key="ClockMinuteLineConverter" DisplayMode="Minutes" />
    <converters:ClockLineConverter x:Key="ClockSecondLineConverter" DisplayMode="Seconds" />
    <converters:NotConverter x:Key="NotConverter" />

    <Style x:Key="MaterialDesignClockItemThumb" TargetType="{x:Type Thumb}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Ellipse Fill="{TemplateBinding Background}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="MaterialDesignCalendarMeridiemRadioButton" TargetType="{x:Type RadioButton}">
        <Setter Property="FontSize" Value="14" />
        <Setter Property="FontWeight" Value="Medium" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RadioButton}">
                    <Grid>
                        <Ellipse Fill="{TemplateBinding Background}" />
                        <ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsChecked" Value="True">
                <Setter Property="Background" Value="{DynamicResource MidContrastPrimaryBrush}" />
                <Setter Property="Foreground" Value="{DynamicResource MidContrastPrimaryForegroundBrush}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="MaterialDesignClock" TargetType="{x:Type wpf:Clock}">
        <Setter Property="Width" Value="280" />
        <Setter Property="Height" Value="470" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="ButtonRadiusRatio" Value=".835" />
        <Setter Property="ButtonRadiusInnerRatio" Value=".6" />
        <Setter Property="Background" Value="{DynamicResource MaterialDesignPaper}" />
        <Setter Property="ButtonStyle">
            <Setter.Value>
                <Style TargetType="{x:Type wpf:ClockItemButton}">
                    <Setter Property="Background" Value="Transparent" />
                    <Setter Property="Width" Value="32" />
                    <Setter Property="Height" Value="32" />
                    <Setter Property="HorizontalContentAlignment" Value="Center" />
                    <Setter Property="VerticalContentAlignment" Value="Center" />
                    <Setter Property="Canvas.ZIndex" Value="0" />
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type wpf:ClockItemButton}">
                                <Grid>
                                    <Thumb Style="{StaticResource MaterialDesignClockItemThumb}" Background="{TemplateBinding Background}" Opacity="23"
												   x:Name="PART_Thumb"/>
                                    <ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
															  IsHitTestVisible="False"/>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                    <Style.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Background" Value="{DynamicResource PrimaryHueLightBrush}" />
                        </Trigger>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter Property="Background" Value="{DynamicResource MidContrastPrimaryBrush}" />
                            <Setter Property="Foreground" Value="{DynamicResource MidContrastPrimaryForegroundBrush}" />
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="LesserButtonStyle">
            <Setter.Value>
                <Style TargetType="{x:Type wpf:ClockItemButton}">
                    <Setter Property="Background" Value="Transparent" />
                    <Setter Property="Width" Value="12" />
                    <Setter Property="Height" Value="12" />
                    <Setter Property="HorizontalContentAlignment" Value="Center" />
                    <Setter Property="VerticalContentAlignment" Value="Center" />
                    <Setter Property="Canvas.ZIndex" Value="1" />
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type wpf:ClockItemButton}">
                                <Grid>
                                    <Thumb Style="{StaticResource MaterialDesignClockItemThumb}" Background="{TemplateBinding Background}" Opacity=".52"
												   x:Name="PART_Thumb"
												   ToolTip="{TemplateBinding Content}"/>
                                    <Ellipse Fill="{TemplateBinding Background}" HorizontalAlignment="Center" VerticalAlignment="Center" Height="6" Width="6"
													 IsHitTestVisible="False"/>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                    <Style.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Background" Value="{DynamicResource PrimaryHueLightBrush}" />
                        </Trigger>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter Property="Background" Value="{DynamicResource MidContrastPrimaryBrush}" />
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type wpf:Clock}">
                    <Border Background="{TemplateBinding Background}"
							BorderBrush="{TemplateBinding BorderBrush}"
        					BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="DisplayModeStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition From="*" To="Hours">
                                        <Storyboard>
                                            <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_HoursCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                                <DiscreteBooleanKeyFrame Value="True" KeyTime="0" />
                                            </BooleanAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_HoursCanvas" Storyboard.TargetProperty="Opacity">
                                                <DiscreteDoubleKeyFrame Value="0" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.4">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseIn" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="HoursScaleTransform" Storyboard.TargetProperty="ScaleX">
                                                <DiscreteDoubleKeyFrame Value="1.2" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="HoursScaleTransform" Storyboard.TargetProperty="ScaleY">
                                                <DiscreteDoubleKeyFrame Value="1.2" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_MinutesCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                                <DiscreteBooleanKeyFrame Value="False" KeyTime="0" />
                                            </BooleanAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_MinutesCanvas" Storyboard.TargetProperty="Opacity">
                                                <DiscreteDoubleKeyFrame Value="1" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="0" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MinutesScaleTransform" Storyboard.TargetProperty="ScaleX">
                                                <DiscreteDoubleKeyFrame Value="1" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value=".85" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MinutesScaleTransform" Storyboard.TargetProperty="ScaleY">
                                                <DiscreteDoubleKeyFrame Value="1" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value=".85" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualTransition>
                                    <VisualTransition From="Hours" To="Minutes">
                                        <Storyboard>
                                            <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_HoursCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                                <DiscreteBooleanKeyFrame Value="False" KeyTime="0" />
                                            </BooleanAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_HoursCanvas" Storyboard.TargetProperty="Opacity">
                                                <DiscreteDoubleKeyFrame Value="1" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="0" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseIn" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="HoursScaleTransform" Storyboard.TargetProperty="ScaleX">
                                                <DiscreteDoubleKeyFrame Value="1" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1.2" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="HoursScaleTransform" Storyboard.TargetProperty="ScaleY">
                                                <DiscreteDoubleKeyFrame Value="1" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1.2" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_MinutesCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                                <DiscreteBooleanKeyFrame Value="True" KeyTime="0" />
                                            </BooleanAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_MinutesCanvas" Storyboard.TargetProperty="Opacity">
                                                <DiscreteDoubleKeyFrame Value="0" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MinutesScaleTransform" Storyboard.TargetProperty="ScaleX">
                                                <DiscreteDoubleKeyFrame Value="0.85" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MinutesScaleTransform" Storyboard.TargetProperty="ScaleY">
                                                <DiscreteDoubleKeyFrame Value="0.85" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualTransition>
                                    <VisualTransition From="Minutes" To="Seconds">
                                        <Storyboard>
                                            <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_MinutesCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                                <DiscreteBooleanKeyFrame Value="False" KeyTime="0" />
                                            </BooleanAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_MinutesCanvas" Storyboard.TargetProperty="Opacity">
                                                <DiscreteDoubleKeyFrame Value="1" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="0" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseIn" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MinutesScaleTransform" Storyboard.TargetProperty="ScaleX">
                                                <DiscreteDoubleKeyFrame Value="1" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1.2" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MinutesScaleTransform" Storyboard.TargetProperty="ScaleY">
                                                <DiscreteDoubleKeyFrame Value="1" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1.2" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_SecondsCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                                <DiscreteBooleanKeyFrame Value="True" KeyTime="0" />
                                            </BooleanAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_SecondsCanvas" Storyboard.TargetProperty="Opacity">
                                                <DiscreteDoubleKeyFrame Value="0" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SecondsScaleTransform" Storyboard.TargetProperty="ScaleX">
                                                <DiscreteDoubleKeyFrame Value="0.85" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SecondsScaleTransform" Storyboard.TargetProperty="ScaleY">
                                                <DiscreteDoubleKeyFrame Value="0.85" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualTransition>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Hours">
                                    <Storyboard>
                                        <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_HoursCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                            <DiscreteBooleanKeyFrame Value="True" KeyTime="0" />
                                        </BooleanAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="PART_HoursCanvas" Storyboard.TargetProperty="Opacity"
                                                         To="1" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="HoursScaleTransform" Storyboard.TargetProperty="ScaleX"
                                                         To="1" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="HoursScaleTransform" Storyboard.TargetProperty="ScaleY"
                                                         To="1" Duration="0" />
                                        <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_MinutesCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                            <DiscreteBooleanKeyFrame Value="False" KeyTime="0" />
                                        </BooleanAnimationUsingKeyFrames>
                                        <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_SecondsCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                            <DiscreteBooleanKeyFrame Value="False" KeyTime="0" />
                                        </BooleanAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="PART_MinutesCanvas" Storyboard.TargetProperty="Opacity"
                                                         To="0" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="MinutesScaleTransform" Storyboard.TargetProperty="ScaleX"
                                                         To=".85" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="MinutesScaleTransform" Storyboard.TargetProperty="ScaleY"
                                                         To=".85" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="PART_SecondsCanvas" Storyboard.TargetProperty="Opacity"
                                                         To="0" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="SecondsScaleTransform" Storyboard.TargetProperty="ScaleX"
                                                         To=".85" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="SecondsScaleTransform" Storyboard.TargetProperty="ScaleY"
                                                         To=".85" Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Minutes">
                                    <Storyboard>
                                        <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_HoursCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                            <DiscreteBooleanKeyFrame Value="False" KeyTime="0" />
                                        </BooleanAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="PART_HoursCanvas" Storyboard.TargetProperty="Opacity"
                                                         To="0" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="HoursScaleTransform" Storyboard.TargetProperty="ScaleX"
                                                         To="1.2" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="HoursScaleTransform" Storyboard.TargetProperty="ScaleY"
                                                         To="1.2" Duration="0" />
                                        <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_MinutesCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                            <DiscreteBooleanKeyFrame Value="True" KeyTime="0" />
                                        </BooleanAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="PART_MinutesCanvas" Storyboard.TargetProperty="Opacity"
                                                         To="1" Duration="0"/>
                                        <DoubleAnimation Storyboard.TargetName="MinutesScaleTransform" Storyboard.TargetProperty="ScaleX"
                                                         To="1" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="MinutesScaleTransform" Storyboard.TargetProperty="ScaleY"
                                                         To="1" Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Seconds">
                                    <Storyboard>
                                        <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_HoursCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                            <DiscreteBooleanKeyFrame Value="False" KeyTime="0" />
                                        </BooleanAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="PART_HoursCanvas" Storyboard.TargetProperty="Opacity"
                                                         To="0" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="HoursScaleTransform" Storyboard.TargetProperty="ScaleX"
                                                         To="1.2" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="HoursScaleTransform" Storyboard.TargetProperty="ScaleY"
                                                         To="1.2" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="PART_MinutesCanvas" Storyboard.TargetProperty="Opacity"
                                                         To="0" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="MinutesScaleTransform" Storyboard.TargetProperty="ScaleX"
                                                         To="1.2" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="MinutesScaleTransform" Storyboard.TargetProperty="ScaleY"
                                                         To="1.2" Duration="0" />
                                        <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_MinutesCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                            <DiscreteBooleanKeyFrame Value="False" KeyTime="0" />
                                        </BooleanAnimationUsingKeyFrames>
                                        <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_SecondsCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                            <DiscreteBooleanKeyFrame Value="True" KeyTime="0" />
                                        </BooleanAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="PART_SecondsCanvas" Storyboard.TargetProperty="Opacity"
                                                         To="1" Duration="0"/>
                                        <DoubleAnimation Storyboard.TargetName="SecondsScaleTransform" Storyboard.TargetProperty="ScaleX"
                                                         To="1" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="SecondsScaleTransform" Storyboard.TargetProperty="ScaleY"
                                                         To="1" Duration="0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Border Background="{DynamicResource PrimaryHueMidBrush}" Height="120"  CornerRadius="2 2 0 0">
                                <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 6 38 0"
                                            x:Name="TimeReadoutStackPanel">
                                    <StackPanel.Resources>
                                        <Style x:Key="TimeTextBlock" TargetType="{x:Type TextBlock}">
                                            <Setter Property="Foreground" Value="{DynamicResource PrimaryHueMidForegroundBrush}" />
                                            <Setter Property="FontSize" Value="66" />
                                            <Setter Property="FontWeight" Value="Normal" />
                                        </Style>
                                    </StackPanel.Resources>
                                    <TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Time, Mode=OneWay, StringFormat={}{0:%h}}"
													   x:Name="PART_HourReadOut">
                                        <TextBlock.Style>
                                            <Style BasedOn="{StaticResource TimeTextBlock}" TargetType="{x:Type TextBlock}">
                                                <Setter Property="Opacity" Value=".56"></Setter>
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DisplayMode}" Value="{x:Static wpf:ClockDisplayMode.Hours}">
                                                        <Setter Property="Opacity" Value="1" />
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </TextBlock.Style>
                                    </TextBlock>
                                    <TextBlock Text=":" Style="{StaticResource TimeTextBlock}" />
                                    <TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Time, Mode=OneWay, StringFormat={}{0:mm}}"
													   x:Name="PART_MinuteReadOut">
                                        <TextBlock.Style>
                                            <Style BasedOn="{StaticResource TimeTextBlock}" TargetType="{x:Type TextBlock}">
                                                <Setter Property="Opacity" Value=".56"></Setter>
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DisplayMode}" Value="{x:Static  wpf:ClockDisplayMode.Minutes}">
                                                        <Setter Property="Opacity" Value="1" />
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </TextBlock.Style>
                                    </TextBlock>
                                    <TextBlock x:Name="PART_SecondColonPrefix" Text=":" Style="{StaticResource TimeTextBlock}" />
                                    <TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Time, Mode=OneWay, StringFormat={}{0:ss}}"
													   x:Name="PART_SecondReadOut">
                                        <TextBlock.Style>
                                            <Style BasedOn="{StaticResource TimeTextBlock}" TargetType="{x:Type TextBlock}">
                                                <Setter Property="Opacity" Value=".56"></Setter>
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DisplayMode}" Value="{x:Static  wpf:ClockDisplayMode.Seconds}">
                                                        <Setter Property="Opacity" Value="1" />
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </TextBlock.Style>
                                    </TextBlock>
                                    <TextBlock FontSize="16"
                                               x:Name="AmPmReadout"
                                               Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Time, Mode=OneWay, StringFormat={}{0:tt}}"
                                               VerticalAlignment="Bottom" Margin="2 0 0 16" Foreground="{DynamicResource PrimaryHueMidForegroundBrush}" />
                                </StackPanel>
                            </Border>
                            <Ellipse x:Name="BackgroundEllipse" Grid.Row="1" Margin="0,24.5,0,94" Width="230" Height="230" Fill="{DynamicResource PrimaryHueLightBrush}" Opacity=".23" />
                            <Canvas x:Name="PART_HoursCanvas" Grid.Row="1" Margin="0,24.5,0,159.5" Width="230" Height="230"
											RenderTransformOrigin=".5,.5">
                                <Path x:Name="HourLine" Data="M2.25,95.515 C2.25,96.036356 1.8582492,96.459 1.375,96.459 C0.89175084,96.459 0.5,96.036356 0.5,95.515 C0.5,94.993643 0.89175084,94.571 1.375,94.571 C1.8582492,94.571 2.25,94.993643 2.25,95.515 z M1.375,95.469003 L1.375,0.50000001" Fill="{DynamicResource MidContrastPrimaryBrush}" Canvas.Left="113.625" Stretch="Fill" Stroke="{DynamicResource MidContrastPrimaryBrush}" Width="2.75" RenderTransformOrigin="0.5,0.985"
                                      Height="96.959" Canvas.Top="19.047">
                                    <Path.RenderTransform>
                                        <RotateTransform Angle="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Time, Converter={StaticResource ClockHourLineConverter}}" />
                                    </Path.RenderTransform>
                                </Path>
                                <Canvas.RenderTransform>
                                    <ScaleTransform x:Name="HoursScaleTransform" ScaleX="1" ScaleY="1" />
                                </Canvas.RenderTransform>
                            </Canvas>
                            <Canvas x:Name="PART_MinutesCanvas" Grid.Row="1" Margin="0,24.5,0,159.5" Width="230" Height="230" Opacity="0" IsHitTestVisible="False"
											RenderTransformOrigin=".5,.5">
                                <Path x:Name="MinuteLine" Data="M2.25,95.515 C2.25,96.036356 1.8582492,96.459 1.375,96.459 C0.89175084,96.459 0.5,96.036356 0.5,95.515 C0.5,94.993643 0.89175084,94.571 1.375,94.571 C1.8582492,94.571 2.25,94.993643 2.25,95.515 z M1.375,95.469003 L1.375,0.50000001" Fill="{DynamicResource MidContrastPrimaryBrush}" Height="96.959" Canvas.Left="113.625" Stretch="Fill" Stroke="{DynamicResource MidContrastPrimaryBrush}" Canvas.Top="19.047" Width="2.75" RenderTransformOrigin="0.5,0.985">
                                    <Path.RenderTransform>
                                        <RotateTransform Angle="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Time, Converter={StaticResource ClockMinuteLineConverter}}" />
                                    </Path.RenderTransform>
                                </Path>
                                <Canvas.RenderTransform>
                                    <ScaleTransform x:Name="MinutesScaleTransform" ScaleX="1" ScaleY="1" />
                                </Canvas.RenderTransform>
                            </Canvas>
                            <Canvas x:Name="PART_SecondsCanvas" Grid.Row="1" Margin="0,24.5,0,159.5" Width="230" Height="230" Opacity="0" IsHitTestVisible="False"
											RenderTransformOrigin=".5,.5">
                                <Path x:Name="SecondLine" Data="M2.25,95.515 C2.25,96.036356 1.8582492,96.459 1.375,96.459 C0.89175084,96.459 0.5,96.036356 0.5,95.515 C0.5,94.993643 0.89175084,94.571 1.375,94.571 C1.8582492,94.571 2.25,94.993643 2.25,95.515 z M1.375,95.469003 L1.375,0.50000001" Fill="{DynamicResource MidContrastPrimaryBrush}" Height="96.959" Canvas.Left="113.625" Stretch="Fill" Stroke="{DynamicResource MidContrastPrimaryBrush}" Canvas.Top="19.047" Width="2.75" RenderTransformOrigin="0.5,0.985">
                                    <Path.RenderTransform>
                                        <RotateTransform Angle="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Time, Converter={StaticResource ClockSecondLineConverter}}" />
                                    </Path.RenderTransform>
                                </Path>
                                <Canvas.RenderTransform>
                                    <ScaleTransform x:Name="SecondsScaleTransform" ScaleX="1" ScaleY="1" />
                                </Canvas.RenderTransform>
                            </Canvas>
                            <RadioButton Content="AM" HorizontalAlignment="Left" Height="47.333" Margin="31.666,0,0,37.667" Grid.Row="1" VerticalAlignment="Bottom" Width="47.333" Style="{StaticResource MaterialDesignCalendarMeridiemRadioButton}"
                                         x:Name="AMRadioButton"
                                         IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsPostMeridiem, Converter={StaticResource NotConverter}}" />
                            <RadioButton Content="PM" HorizontalAlignment="Right" Height="47.333" Margin="0,0,31.667,37.667" Grid.Row="1" VerticalAlignment="Bottom" Width="47.333" Style="{StaticResource MaterialDesignCalendarMeridiemRadioButton}"
                                         x:Name="PMRadioButton"
                                         IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsPostMeridiem}" />
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="Is24Hours" Value="True">
                            <Setter TargetName="PART_HourReadOut" Property="Text" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Time, Mode=OneWay, StringFormat={}{0:HH}}" />
                            <Setter TargetName="TimeReadoutStackPanel" Property="HorizontalAlignment" Value="Center" />
                            <Setter TargetName="TimeReadoutStackPanel" Property="Margin" Value="0 6 0 0" />
                            <Setter TargetName="AmPmReadout" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="AMRadioButton" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="PMRadioButton" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="BackgroundEllipse" Property="Margin" Value="0,24.5,0,26" />
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Is24Hours" Value="True" />
                                <Condition Property="IsPostMeridiem" Value="False" />
                                <Condition Property="IsMidnightHour" Value="False" />
                            </MultiTrigger.Conditions>
                            <Setter TargetName="HourLine" Property="Height" Value="76" />
                            <Setter TargetName="HourLine" Property="Canvas.Top" Value="40" />
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Is24Hours" Value="True" />
                                <Condition Property="IsMiddayHour" Value="True" />
                            </MultiTrigger.Conditions>
                            <Setter TargetName="HourLine" Property="Height" Value="76" />
                            <Setter TargetName="HourLine" Property="Canvas.Top" Value="40" />
                        </MultiTrigger>
                        <Trigger Property="DisplayAutomation" Value="{x:Static  wpf:ClockDisplayAutomation.None}">
                            <Setter TargetName="PART_SecondReadOut" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="PART_SecondColonPrefix" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="TimeReadoutStackPanel" Property="Margin" Value="0 6 38 0" />
                        </Trigger>
                        <Trigger Property="DisplayAutomation" Value="{x:Static  wpf:ClockDisplayAutomation.Cycle}">
                            <Setter TargetName="PART_SecondReadOut" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="PART_SecondColonPrefix" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="TimeReadoutStackPanel" Property="Margin" Value="0 6 38 0" />
                        </Trigger>
                        <Trigger Property="DisplayAutomation" Value="{x:Static  wpf:ClockDisplayAutomation.ToMinutesOnly}">
                            <Setter TargetName="PART_SecondReadOut" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="PART_SecondColonPrefix" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="TimeReadoutStackPanel" Property="Margin" Value="0 6 38 0" />
                        </Trigger>
                        <Trigger Property="DisplayAutomation" Value="{x:Static  wpf:ClockDisplayAutomation.ToSeconds}">
                            <Setter TargetName="PART_SecondReadOut" Property="Visibility" Value="Visible" />
                            <Setter TargetName="PART_SecondColonPrefix" Property="Visibility" Value="Visible" />
                            <Setter TargetName="TimeReadoutStackPanel" Property="Margin" Value="0 6 0 0" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="Is24Hours" Value="True">
                <Setter Property="Height" Value="402" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="MaterialDesignDueDateClock" BasedOn="{StaticResource MaterialDesignClock}" TargetType="{x:Type wpf:Clock}">
        <Setter Property="Margin" Value="-1,0,0,0"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Height" Value="Auto"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type wpf:Clock}">
                    <Border Background="{TemplateBinding Background}"
							BorderBrush="{TemplateBinding BorderBrush}"
        					BorderThickness="{TemplateBinding BorderThickness}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="DisplayModeStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition From="*" To="Hours">
                                        <Storyboard>
                                            <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_HoursCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                                <DiscreteBooleanKeyFrame Value="True" KeyTime="0" />
                                            </BooleanAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_HoursCanvas" Storyboard.TargetProperty="Opacity">
                                                <DiscreteDoubleKeyFrame Value="0" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.4">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseIn" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="HoursScaleTransform" Storyboard.TargetProperty="ScaleX">
                                                <DiscreteDoubleKeyFrame Value="1.2" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="HoursScaleTransform" Storyboard.TargetProperty="ScaleY">
                                                <DiscreteDoubleKeyFrame Value="1.2" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_MinutesCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                                <DiscreteBooleanKeyFrame Value="False" KeyTime="0" />
                                            </BooleanAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_MinutesCanvas" Storyboard.TargetProperty="Opacity">
                                                <DiscreteDoubleKeyFrame Value="1" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="0" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MinutesScaleTransform" Storyboard.TargetProperty="ScaleX">
                                                <DiscreteDoubleKeyFrame Value="1" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value=".85" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MinutesScaleTransform" Storyboard.TargetProperty="ScaleY">
                                                <DiscreteDoubleKeyFrame Value="1" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value=".85" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualTransition>
                                    <VisualTransition From="Hours" To="Minutes">
                                        <Storyboard>
                                            <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_HoursCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                                <DiscreteBooleanKeyFrame Value="False" KeyTime="0" />
                                            </BooleanAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_HoursCanvas" Storyboard.TargetProperty="Opacity">
                                                <DiscreteDoubleKeyFrame Value="1" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="0" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseIn" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="HoursScaleTransform" Storyboard.TargetProperty="ScaleX">
                                                <DiscreteDoubleKeyFrame Value="1" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1.2" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="HoursScaleTransform" Storyboard.TargetProperty="ScaleY">
                                                <DiscreteDoubleKeyFrame Value="1" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1.2" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_MinutesCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                                <DiscreteBooleanKeyFrame Value="True" KeyTime="0" />
                                            </BooleanAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_MinutesCanvas" Storyboard.TargetProperty="Opacity">
                                                <DiscreteDoubleKeyFrame Value="0" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MinutesScaleTransform" Storyboard.TargetProperty="ScaleX">
                                                <DiscreteDoubleKeyFrame Value="0.85" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MinutesScaleTransform" Storyboard.TargetProperty="ScaleY">
                                                <DiscreteDoubleKeyFrame Value="0.85" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualTransition>
                                    <VisualTransition From="Minutes" To="Seconds">
                                        <Storyboard>
                                            <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_MinutesCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                                <DiscreteBooleanKeyFrame Value="False" KeyTime="0" />
                                            </BooleanAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_MinutesCanvas" Storyboard.TargetProperty="Opacity">
                                                <DiscreteDoubleKeyFrame Value="1" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="0" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseIn" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MinutesScaleTransform" Storyboard.TargetProperty="ScaleX">
                                                <DiscreteDoubleKeyFrame Value="1" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1.2" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MinutesScaleTransform" Storyboard.TargetProperty="ScaleY">
                                                <DiscreteDoubleKeyFrame Value="1" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1.2" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_SecondsCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                                <DiscreteBooleanKeyFrame Value="True" KeyTime="0" />
                                            </BooleanAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_SecondsCanvas" Storyboard.TargetProperty="Opacity">
                                                <DiscreteDoubleKeyFrame Value="0" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SecondsScaleTransform" Storyboard.TargetProperty="ScaleX">
                                                <DiscreteDoubleKeyFrame Value="0.85" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="SecondsScaleTransform" Storyboard.TargetProperty="ScaleY">
                                                <DiscreteDoubleKeyFrame Value="0.85" KeyTime="0" />
                                                <EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.5">
                                                    <EasingDoubleKeyFrame.EasingFunction>
                                                        <SineEase EasingMode="EaseOut" />
                                                    </EasingDoubleKeyFrame.EasingFunction>
                                                </EasingDoubleKeyFrame>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualTransition>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Hours">
                                    <Storyboard>
                                        <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_HoursCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                            <DiscreteBooleanKeyFrame Value="True" KeyTime="0" />
                                        </BooleanAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="PART_HoursCanvas" Storyboard.TargetProperty="Opacity"
                                                         To="1" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="HoursScaleTransform" Storyboard.TargetProperty="ScaleX"
                                                         To="1" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="HoursScaleTransform" Storyboard.TargetProperty="ScaleY"
                                                         To="1" Duration="0" />
                                        <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_MinutesCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                            <DiscreteBooleanKeyFrame Value="False" KeyTime="0" />
                                        </BooleanAnimationUsingKeyFrames>
                                        <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_SecondsCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                            <DiscreteBooleanKeyFrame Value="False" KeyTime="0" />
                                        </BooleanAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="PART_MinutesCanvas" Storyboard.TargetProperty="Opacity"
                                                         To="0" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="MinutesScaleTransform" Storyboard.TargetProperty="ScaleX"
                                                         To=".85" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="MinutesScaleTransform" Storyboard.TargetProperty="ScaleY"
                                                         To=".85" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="PART_SecondsCanvas" Storyboard.TargetProperty="Opacity"
                                                         To="0" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="SecondsScaleTransform" Storyboard.TargetProperty="ScaleX"
                                                         To=".85" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="SecondsScaleTransform" Storyboard.TargetProperty="ScaleY"
                                                         To=".85" Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Minutes">
                                    <Storyboard>
                                        <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_HoursCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                            <DiscreteBooleanKeyFrame Value="False" KeyTime="0" />
                                        </BooleanAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="PART_HoursCanvas" Storyboard.TargetProperty="Opacity"
                                                         To="0" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="HoursScaleTransform" Storyboard.TargetProperty="ScaleX"
                                                         To="1.2" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="HoursScaleTransform" Storyboard.TargetProperty="ScaleY"
                                                         To="1.2" Duration="0" />
                                        <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_MinutesCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                            <DiscreteBooleanKeyFrame Value="True" KeyTime="0" />
                                        </BooleanAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="PART_MinutesCanvas" Storyboard.TargetProperty="Opacity"
                                                         To="1" Duration="0"/>
                                        <DoubleAnimation Storyboard.TargetName="MinutesScaleTransform" Storyboard.TargetProperty="ScaleX"
                                                         To="1" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="MinutesScaleTransform" Storyboard.TargetProperty="ScaleY"
                                                         To="1" Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Seconds">
                                    <Storyboard>
                                        <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_HoursCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                            <DiscreteBooleanKeyFrame Value="False" KeyTime="0" />
                                        </BooleanAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="PART_HoursCanvas" Storyboard.TargetProperty="Opacity"
                                                         To="0" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="HoursScaleTransform" Storyboard.TargetProperty="ScaleX"
                                                         To="1.2" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="HoursScaleTransform" Storyboard.TargetProperty="ScaleY"
                                                         To="1.2" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="PART_MinutesCanvas" Storyboard.TargetProperty="Opacity"
                                                         To="0" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="MinutesScaleTransform" Storyboard.TargetProperty="ScaleX"
                                                         To="1.2" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="MinutesScaleTransform" Storyboard.TargetProperty="ScaleY"
                                                         To="1.2" Duration="0" />
                                        <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_MinutesCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                            <DiscreteBooleanKeyFrame Value="False" KeyTime="0" />
                                        </BooleanAnimationUsingKeyFrames>
                                        <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_SecondsCanvas" Storyboard.TargetProperty="IsHitTestVisible">
                                            <DiscreteBooleanKeyFrame Value="True" KeyTime="0" />
                                        </BooleanAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="PART_SecondsCanvas" Storyboard.TargetProperty="Opacity"
                                                         To="1" Duration="0"/>
                                        <DoubleAnimation Storyboard.TargetName="SecondsScaleTransform" Storyboard.TargetProperty="ScaleX"
                                                         To="1" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="SecondsScaleTransform" Storyboard.TargetProperty="ScaleY"
                                                         To="1" Duration="0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Ellipse x:Name="BackgroundEllipse" Grid.Row="1" Margin="0,24.5" Width="230" Height="230" VerticalAlignment="Top" Fill="{DynamicResource PrimaryHueLightBrush}" Opacity=".23" />
                            <Canvas x:Name="PART_HoursCanvas" Grid.Row="1" Margin="0,24.5" Width="230" Height="230"
											RenderTransformOrigin=".5,.5">
                                <Path x:Name="HourLine" Data="M2.25,95.515 C2.25,96.036356 1.8582492,96.459 1.375,96.459 C0.89175084,96.459 0.5,96.036356 0.5,95.515 C0.5,94.993643 0.89175084,94.571 1.375,94.571 C1.8582492,94.571 2.25,94.993643 2.25,95.515 z M1.375,95.469003 L1.375,0.50000001" Fill="{DynamicResource MidContrastPrimaryBrush}" Canvas.Left="113.625" Stretch="Fill" Stroke="{DynamicResource MidContrastPrimaryBrush}" Width="2.75" RenderTransformOrigin="0.5,0.985"
                                      Height="96.959" Canvas.Top="19.047">
                                    <Path.RenderTransform>
                                        <RotateTransform Angle="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Time, Converter={StaticResource ClockHourLineConverter}}" />
                                    </Path.RenderTransform>
                                </Path>
                                <Canvas.RenderTransform>
                                    <ScaleTransform x:Name="HoursScaleTransform" ScaleX="1" ScaleY="1" />
                                </Canvas.RenderTransform>
                            </Canvas>
                            <Canvas x:Name="PART_MinutesCanvas" Grid.Row="1" Margin="0,24.5" Width="230" Height="230" Opacity="0" IsHitTestVisible="False"
											RenderTransformOrigin=".5,.5">
                                <Path x:Name="MinuteLine" Data="M2.25,95.515 C2.25,96.036356 1.8582492,96.459 1.375,96.459 C0.89175084,96.459 0.5,96.036356 0.5,95.515 C0.5,94.993643 0.89175084,94.571 1.375,94.571 C1.8582492,94.571 2.25,94.993643 2.25,95.515 z M1.375,95.469003 L1.375,0.50000001" Fill="{DynamicResource MidContrastPrimaryBrush}" Height="96.959" Canvas.Left="113.625" Stretch="Fill" Stroke="{DynamicResource MidContrastPrimaryBrush}" Canvas.Top="19.047" Width="2.75" RenderTransformOrigin="0.5,0.985">
                                    <Path.RenderTransform>
                                        <RotateTransform Angle="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Time, Converter={StaticResource ClockMinuteLineConverter}}" />
                                    </Path.RenderTransform>
                                </Path>
                                <Canvas.RenderTransform>
                                    <ScaleTransform x:Name="MinutesScaleTransform" ScaleX="1" ScaleY="1" />
                                </Canvas.RenderTransform>
                            </Canvas>
                            <Canvas x:Name="PART_SecondsCanvas" Grid.Row="1" Margin="0,24.5" Width="230" Height="230" Opacity="0" IsHitTestVisible="False"
											RenderTransformOrigin=".5,.5">
                                <Path x:Name="SecondLine" Data="M2.25,95.515 C2.25,96.036356 1.8582492,96.459 1.375,96.459 C0.89175084,96.459 0.5,96.036356 0.5,95.515 C0.5,94.993643 0.89175084,94.571 1.375,94.571 C1.8582492,94.571 2.25,94.993643 2.25,95.515 z M1.375,95.469003 L1.375,0.50000001" Fill="{DynamicResource MidContrastPrimaryBrush}" Height="96.959" Canvas.Left="113.625" Stretch="Fill" Stroke="{DynamicResource MidContrastPrimaryBrush}" Canvas.Top="19.047" Width="2.75" RenderTransformOrigin="0.5,0.985">
                                    <Path.RenderTransform>
                                        <RotateTransform Angle="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Time, Converter={StaticResource ClockSecondLineConverter}}" />
                                    </Path.RenderTransform>
                                </Path>
                                <Canvas.RenderTransform>
                                    <ScaleTransform x:Name="SecondsScaleTransform" ScaleX="1" ScaleY="1" />
                                </Canvas.RenderTransform>
                            </Canvas>
                            <RadioButton Content="AM" HorizontalAlignment="Left" Height="47.333" Margin="31.666,0,0,37.667" Grid.Row="1" VerticalAlignment="Bottom" Width="47.333" Style="{StaticResource MaterialDesignCalendarMeridiemRadioButton}"
                                         x:Name="AMRadioButton"
                                         IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsPostMeridiem, Converter={StaticResource NotConverter}}" />
                            <RadioButton Content="PM" HorizontalAlignment="Right" Height="47.333" Margin="0,0,31.667,37.667" Grid.Row="1" VerticalAlignment="Bottom" Width="47.333" Style="{StaticResource MaterialDesignCalendarMeridiemRadioButton}"
                                         x:Name="PMRadioButton"
                                         IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsPostMeridiem}" />
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="Is24Hours" Value="True">
                            <Setter TargetName="AMRadioButton" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="PMRadioButton" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Is24Hours" Value="True" />
                                <Condition Property="IsPostMeridiem" Value="False" />
                                <Condition Property="IsMidnightHour" Value="False" />
                            </MultiTrigger.Conditions>
                            <Setter TargetName="HourLine" Property="Height" Value="76" />
                            <Setter TargetName="HourLine" Property="Canvas.Top" Value="40" />
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Is24Hours" Value="True" />
                                <Condition Property="IsMiddayHour" Value="True" />
                            </MultiTrigger.Conditions>
                            <Setter TargetName="HourLine" Property="Height" Value="76" />
                            <Setter TargetName="HourLine" Property="Canvas.Top" Value="40" />
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="Is24Hours" Value="True">
                <Setter Property="Height" Value="Auto" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="{x:Type wpf:Clock}" TargetType="{x:Type wpf:Clock}" BasedOn="{StaticResource MaterialDesignClock}"/>
</ResourceDictionary>
